<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/component/pear/css/pear.css"/>
    <style>
        label.required:after { /* 给红色的必填项打红色星号（文字后）如果打前面用before*/
            content: ' *';
            color: red;
        }

        .layui-form-label {
            width: 80px;
            height: 50px;
            line-height: 45px;
            padding: 0px;
        }

        .layui-input-block {
            margin-left: 90px;
        }

        .layui-form .layui-input-inline {
            margin-left: 30px;
            width: 290px;
        }

        .main-container .layui-form-item {
            margin: 10px 0px !important;
        }

        .layui-input {
            height: 50px;
        }

        .submit-btn-container .layui-btn, .pear-btn {
            height: 45px;
            width: 130px;
            font-size: 20px;
        }

        .pear-btn i {
            font-size: 20px;
        }

        .layui-form-select dl, .dtree-select {
            position: absolute;
            left: 0;
            top: 51px;
        }

        .layui-form-selectup dl {
            top: auto;
            bottom: 51px;
        }

        .layui-select-disabled .layui-disabled {
            color: black !important;
        }

        .layui-select-disabled .layui-disabled, .layui-input[disabled], .layui-textarea[disabled] {
            color: rgba(0, 0, 0, .85) !important;
        }

        .layui-input[disabled], .layui-textarea[disabled] {
            background-color: white;
        }

        .layui-radio-disabled > * {
            color: black !important;
        }
    </style>
</head>
<body>
<div class="main-container">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" style="font-size: 16px;">
        <form class="layui-form" action="" onsubmit="return false">
            <div class="layui-form-item" style="display: none;">
                <div class="layui-input-block">
                    <input type="text" th:value="${archives.archives_subname_id}"
                           disabled name="id"
                           autocomplete="off" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">档案id</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.file_id}"
                                   disabled
                                   autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">档案盒名</label>
                        <div class="layui-input-block">
                            <input type="text" required lay-verify="required"
                                   th:value="${archives.file_name}"
                                   disabled
                                   lay-reqtext="请输入档案名" autocomplete="off"
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">图纸名称</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.son_file_name}"
                                   disabled
                                   autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">图纸数量</label>
                        <div class="layui-input-block">
                            <input type="text" required lay-verify="required"
                                   th:value="${archives.drawing_count}"
                                   disabled
                                   lay-reqtext="请输入档案名" autocomplete="off"
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">档案分类</label>
                        <div class="layui-input-block">
                            <input type="text" required lay-verify="required"
                                   th:value="${archives.type_name}"
                                   disabled
                                   lay-reqtext="请输入档案名" autocomplete="off"
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">年度</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input layui-disabled" autocomplete="off"
                                   th:value="${archives.year}" disabled id="ArchiveDate">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">责任人</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input layui-disabled" autocomplete="off"
                                   th:value="${archives.user_name}" disabled
                                   id="userName" placeholder="请选择年度">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">档案简介</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.profile}" disabled
                                   autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">位置</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.position}" autocomplete="off" disabled
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">库房位置</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.area_name}" disabled autocomplete="off"
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">列号</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.column_number}" disabled
                                   autocomplete="off" class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">密集架区</label>
                        <div class="layui-input-block">
                            <select disabled>
                                <option value="0" th:selected="${archives.dense_rack_region eq 0}">左区</option>
                                <option value="1" th:selected="${archives.dense_rack_region eq 1}">右区</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item">
                        <label class="layui-form-label required">节数</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.joint}" autocomplete="off" disabled
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
                    <div class="layui-form-item" th:if="${sysType eq 1}">
                        <label class="layui-form-label required">层数</label>
                        <div class="layui-input-block">
                            <input type="text" th:value="${archives.layer_number}" autocomplete="off" disabled
                                   class="layui-input layui-disabled">
                        </div>
                    </div>
                </div>
            </div>
<!--            <div class="layui-row">-->
<!--                <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">-->
<!--                    <div class="layui-form-item">-->
<!--                        <label class="layui-form-label">档案状态</label>-->
<!--                        <div class="layui-input-block">-->
<!--                            <input type="radio" value="0" title="在库"-->
<!--                                   th:checked="${archives.status eq 0}" disabled>-->
<!--                            <input type="radio" value="1" title="未在库"-->
<!--                                   th:checked="${archives.status eq 1}" disabled>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="layui-form-item" style="margin: 0px !important;">
                <div style="width: 100%;height: 1px;background: #E9E9E9;"></div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label required">归还数量</label>
                <div class="layui-input-block">
                    <input type="number" name="returningCount" placeholder="请输入归还图纸总数" id="drawingCount" required min="1"
                           lay-verify="required" lay-reqtext="请输入归还图纸总数" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">归还备注</label>
                <div class="layui-input-block">
                    <textarea name="remarks" placeholder="请输入归还备注" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-form-item submit-btn-container">
                    <div class="layui-input-block" style="display: flex;flex-direction: row;justify-content: center;">
                        <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="takeOutSave">
                            <i class="layui-icon layui-icon-ok-circle"></i>
                            归还
                        </button>
                        <button type="reset" class="layui-btn layui-btn-primary" style="margin-left: 25px">清空
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="/component/layui/layui.js"></script>
<script src="/component/pear/pear.js"></script>
<script>
    layui.use(['form', 'jquery'], function () {
        var form = layui.form,
            $ = layui.jquery;

        form.on('submit(takeOutSave)', function (data) {
            let loading = layer.load();
            $.ajax({
                url: '/archives/subname/returning/save',
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function (result) {
                    layer.close(loading);
                    if (result.code === 200) {
                        layer.msg(result.message, {icon: 1, time: 3000}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));
                        });
                    } else {
                        layer.msg(result.message, {icon: 2, time: 3000});
                    }
                }
            })
            return false;
        });

    });
</script>
</body>
</html>